//void, Obj owner
Query qBarbarian;
ObjList l;
Unit this, unit;
int j, count;

this = owner.AsUnit;
if (!.IsValid) return;

Sleep(rand(1000) + 500);
//DiplCeaseFire(.player,10,true);
//DiplCeaseFire(10,.player,true);
//DiplShareView(.player,10,true);
//DiplShareView(10,.player,true);
//DiplShareControl(.player,10,true);
//DiplShareControl(10,.player,true);
// find animals around 
qBarbarian = Intersect(ObjsInRange(this, "Military", 500), ClassPlayerObjs("Military", 15));

while(1){

	Sleep(2000+rand(15000));
	
	if (qBarbarian.count == 0)
		continue;
	
	l = qBarbarian.GetObjList();
	l.ClearDead(); 
	count = l.count;
	
	if (count == 0)
		continue;
    
	j = rand(count);
	unit = l[j];
	if(unit.IsValid){
		if(unit.player == 15){
			if(!unit.IsHeirOf("Sentry")){
				//unit.SetLevel(.level);
				//unit.AddBonus(204,55,0,0,0);
				unit.SetPlayer(.player);
				CreateFeedback("Rage", this);
				CreateFeedback("Rage", unit);
				Sleep(2000+rand(15000));
			}
		}
	}

}